<template>
  <div class="wrapper">
    <swiper :options="swiperOption" v-if="showSwiper">
      <swiper-slide v-for="(item,index) of list" :key="index">
        <img class="swiper-img" :src="item.properties.image">
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'homeBanner',
  data() {
    return {
      swiperOption: {
        pagination: {
          el: '.swiper-pagination'
        },
        loop: true
      }
    }
  },
  props: {
    list: {
      type: Array,
      default: () => []
    }
  },
  computed: {
    showSwiper() {
      return this.list.length
    }
  }
}
</script>

<style lang="less" scoped>
.wrapper{
  overflow:hidden;
  width:100%;
  height:0;
  padding-bottom:55.56%;
  background: #eee
}
.swiper-img{
  width:100%;
  height:100%;
}

</style>
